public class MoveZeros {
    //移动零
    public void code(int[] nums) {
        int dest = -1, cur = 0;
        for (; cur < nums.length; cur++){
            if (nums[cur] != 0){
                dest++;
                int tmp = nums[cur];
                nums[cur] = nums[dest];
                nums[dest] = tmp;
            }
        }

    }

    public static void main(String[] args) {

    }
}
